<?php
    use yii\bootstrap\ActiveForm;
    use yii\helpers\Html;
    $this->title = '创建角色';
    $this->params['breadcrumbs'][] = ['label' => '角色管理', 'url' => ['rbac/roles']];
    $this->params['breadcrumbs'][] = $this->title;
    $this->registerCssFile('/statics/compiled/new-user.css');
?>
    <!-- main container -->
    <div class='content'>
        <div class="container-fluid">
            <div id="pad-wrapper" class="new-user">
                <div class="row-fluid header">
                    <h3>创建角色</h3>
                </div>
                <div class="row-fluid form-wrapper">
                    <!-- left column -->
                    <div class="span9 with-sidebar">
                        <div class="container">
                                <?php
                                    if (Yii::$app->session->hasFlash('info')) {
                                        echo Yii::$app->session->getFlash('info');
                                    }
                                    $form = ActiveForm::begin([
                                        'fieldConfig' => [
                                            'template' => '<div class="span12 field-box">{label}{input}</div>{error}',
                                        ],
                                        'options' => [
                                            'class' => 'new_user_form inline-input',
                                        ],
                                    ]);

                                ?>
                                <div class="span12 field-box">
                                <?php echo Html::label('名称', null). Html::textInput('description', '', ['class' => 'span9']); ?>
                                </div>
                                <div class="span12 field-box">
                                <?php echo Html::label('标识', null). Html::textInput('name', '', ['class' => 'span9']); ?>
                                </div>
                                <div class="span12 field-box">
                                <?php echo Html::label('规则名称', null). Html::textInput('rule_name', '', ['class' => 'span9']); ?>
                                </div>
                                <div class="span12 field-box">
                                <?php echo Html::label('数据', null). Html::textarea('data', '', ['class' => 'span9']); ?>
                                </div>

                                <div class="span11 field-box actions">
                                    <?php echo Html::submitButton('添加', ['class' => 'btn-glow primary']); ?>
                                    <span>OR</span>
                                    <?php echo Html::resetButton('取消', ['class' => 'reset']); ?>
                                </div>
                            <?php ActiveForm::end(); ?>
                        </div>
                    </div>
                </div>
            </div>
        </div>
     </div>
    <!-- end main container -->

